<template>
	<el-drawer title="投标项目详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="投标企业" prop="entName">{{form.entName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="招标项目" prop="title">{{form.title}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="投标日期" prop="revTime">{{form.revTime}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="联系人" prop="linkMan">{{form.linkMan}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="联系电话" prop="tel">{{form.tel}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="电子邮件" prop="email">{{form.email}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="备注说明" prop="remark">{{form.remark}}</el-form-item>
					<el-form-item label="招标文件" prop="attachId">
						<attach-menu v-model:attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
					</el-form-item>
					<el-divider>供应商评分</el-divider>
					<scTable ref="table" :data="evalData" row-key="recordId" stripe remoteSort remoteFilter  style="height: 50%">
						<el-table-column label="#" type="index" width="50"></el-table-column>
						<el-table-column label="评标人" prop="title" width="200" :show-overflow-tooltip="true">
							<template #default="scope">
								<el-avatar :src="scope.row.avatar" size="small" style="display: inline-block;position: absolute;"></el-avatar><span style="display: inline-block;padding-left:30px">{{scope.row.userName}}</span>
							</template>
						</el-table-column>
						<el-table-column label="投标企业" prop="entName" width="200" :show-overflow-tooltip="true"></el-table-column>
						<el-table-column label="得分" prop="score" width="100"></el-table-column>
						<el-table-column label="备注说明" prop="remark" width="100" :show-overflow-tooltip="true"></el-table-column>
					</scTable>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			form: {
				recordId:'',
				entName: '',
				title: "",
				revTime: '',
				attachId: '',
				linkMan:'',
				tel:'',
				email:'',
				remark: '',
				status:'0'
			},
			evalData:[],
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		async getInviteEvaluationByInviteIdList(inviteId){
			let res = await this.$API.invite.inviteEvaluation.getInviteEvaluationByInviteIdList.get({inviteId:inviteId});
			if(res.code==200)
			{
				this.evalData = res.data;
			}
		},
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.recordId = data.recordId
			this.form.entName = data.entName
			this.form.title = data.title
			this.form.revTime = data.revTime
			this.form.attachId = data.attachId
			this.form.linkMan = data.linkMan
			this.form.tel = data.tel
			this.form.email = data.email
			this.form.remark = data.remark
			this.getInviteEvaluationByInviteIdList(data.inviteId)
		},
	}
}
</script>

<style>
</style>
